<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="contact.domain.DAOContact"%>
<%@page import="contact.domain.Contact"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Iterator"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" media="screen" href="style.css">
<title>Update Contact</title>
</head>
<body>
<jsp:include page="menu.html" />
<form id="update" action="updateContact2.jsp">
<h1>Update Contact</h1>
<table>
	<tr>
		<th>Id</th>
		<th>Firstname</th>
		<th>Lastname</th>
		<th>Email</th>
		<th>Street</th>
		<th>City</th>
		<th>Zip</th>
		<th>Country</th>
		<th></th>
	</tr>
	<%
		DAOContact dao = new DAOContact();
		List contacts = dao.getAllContact();
		Iterator iter = contacts.iterator();
		while (iter.hasNext()) {
			Contact contact = (Contact) iter.next();
			out.println("<tr><td>" + contact.getId() + "</td><td>"
					+ contact.getFirstName() + "</td><td>"
					+ contact.getLastName() + "</td><td>"
					+ contact.getEmail() + "</td><td>"
					+ contact.getAddress().getStreet() + "</td><td>"
					+ contact.getAddress().getCity() + "</td><td>"
					+ contact.getAddress().getZip() + "</td><td>"
					+ contact.getAddress().getCountry()
					+ "</td><td><input type=\"radio\" name=\"id\" value=\""
					+ contact.getId() + "\"></input></td></tr>");
		}
	%>
</table>
<input type="submit" value="Update" /></form>
</body>
</html>